package sicnu.cs.ich.ich.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import sicnu.cs.ich.api.common.ResultInfo;
import sicnu.cs.ich.api.domain.dto.IchHitDTO;

import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;

/**
 * @author CaiKe
 * @date 2021/12/2 13:51
 */
@FeignClient(name = "ich-ranking-service",
        path = "ich")
public interface IchRankingClient {

    /**
     * 获取非遗类别热度榜
     *
     * @return
     */
    @GetMapping("type/hit")
    ResultInfo<int[]> getTypeHit();


    /**
     * 从非遗热度榜中获取size个非遗的ichId
     */
    @GetMapping("hit")
    List<Integer> getHitIchs(@RequestParam Integer size) throws InterruptedException;


    /**
     * 后台调用手动排序
     */
    @GetMapping("hit/refresh")
    ResultInfo<PriorityQueue<IchHitDTO>> sortAndReturn();


    /**
     * 调用排序，同时获取非遗排行榜
     */
    @GetMapping("/sortAndGet")
    List<Integer> sortAndGet() throws InterruptedException;
}